package com.blueocean.care.management.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;

/**
 * @version 1.0
 * @author: zwg.BlueOcean
 * @date 2018/7/31 11:09
 * @description 自定义预处理拦截，适合做权限验证，请求预处理
 */
public class Pre0CustomFilter extends ZuulFilter{
    @Override
    public String filterType() {
        return "pre";
    }

    @Override
    public int filterOrder() {
        return 0;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public Object run() {
        System.err.println("pre filter");
        RequestContext ctx = RequestContext.getCurrentContext();
        //TODO:加入权限验证逻辑

        return null;
    }
}
